package com.informix.stream.api.records;

import com.informix.stream.api.IfmxStreamRecord;
import com.informix.stream.common.enums.IfmxStreamRecordType;

import java.nio.ByteBuffer;
import java.util.LinkedHashMap;

public class IfxCDCMetaDataRecord extends IfxCDCRecord implements IfmxStreamRecord {
    private final LinkedHashMap<String, LinkedHashMap<String, String>> columns;

    public IfxCDCMetaDataRecord(LinkedHashMap<String, LinkedHashMap<String, String>> columns, byte[] header) {
        super(IfmxStreamRecordType.METADATA);
        this.label = Integer.toString(ByteBuffer.wrap(header).getInt());
        this.columns = columns;
    }

    public LinkedHashMap<String, LinkedHashMap<String, String>> getColumns() {
        return this.columns;
    }

    @Override
    public String toString() {
        return super.toString() + " Columns: " + this.columns.toString();
    }
}
